<template>
  <a-card :bordered="false">

    <div class="table-page-search-wrapper">
      <a-form layout="inline" >
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="操作用户">
              <a-input v-model="searchParam.username" placeholder=""/>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="创建时间">
              <m-range-picker allowClear v-model="searchParam.createdTime"></m-range-picker>
            </a-form-item>
          </a-col>
          <template v-if="advanced">
          </template>
          <a-col :md="!advanced && 8 || 24" :sm="24">
            <span class="table-page-search-submitButtons"
                  :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
              <a-button type="primary" @click="search">查询</a-button>
              <a-button style="margin-left: 8px" @click="reset">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>

    <div class="table-operator">

    </div>

    <a-table
      :rowKey=" (record => record.id)"
      :dataSource="tableData"
      :pagination="pagination"
      :loading="loading"
      @change="tableChange"
    >
      <a-table-column title="操作用户" dataIndex="username" key="username"/>
      <a-table-column title="ip地址" dataIndex="ip" key="ip"/>
      <a-table-column title="操作内容" dataIndex="content" key="content"/>

      <a-table-column title="参数" dataIndex="params" key="params">
        <template slot-scope="params">
          <ellipsis :length="30" tooltip>
            {{params}}
          </ellipsis>
        </template>
      </a-table-column>
      <a-table-column title="类型" dataIndex="type" key="type" :filters="typeFilters" :filtered="true"  :filterMultiple="true" />
      <a-table-column title="时间" dataIndex="createdTime" key="createdTime" :sorter="true"/>
    </a-table>

  </a-card>
</template>


<script>
  import curdMixins from '../../../common/mixins/curdMixins'
  import { selectPage } from '../../../api/base/syslog'

  export default {
    name: 'syslog',
    mixins: [curdMixins],
    data(){
      return{
            typeFilters:[{text:'查询',value:"0" },{text:'添加',value:"1" },{text:'删除',value:"2" },{text:'修改',value:"3" },{text:'导入',value:"4" },{text:'导出',value:"5" }],
      }
    },
    methods: {
      getList(param) {
        return selectPage(param)
      }
    }
  }
</script>

<style scoped>

</style>